﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestCenter.Platform.DataModel;
using System.Collections.ObjectModel;
using RapidWebDev.Platform;

namespace TestCenter.Platform.Apis
{
    public interface ITestCenterApi
    {
        string SaveTestProject(TestProject entity, string ParentId);

        string SaveTestSuite(TestSuite entity, string ParentId);

        string SaveTestCase(TestCase entity, string ParentId);

        string SaveBuild(Build entity, string ParentId);

        string SaveTestPlan(TestPlan entity, string ParentId);

        TestProject GetTestProjectById(Guid entityId);

        IEnumerable<TestProject> GetAllTestProject();

        TestSuite GetTestSuiteById(Guid entityId);

        TestCase GetTestCaseById(Guid entityId);

        TestPlan GetTestPlanById(Guid entityId);

        Build GetBuildById(Guid entityId);

        Collection<TestProject> FindTestProjects(LinqPredicate predicate, string orderby, int pageIndex, int pageSize, out int recordCount);

        Collection<TestSuite> FindTestSuites(LinqPredicate predicate, string orderby, int pageIndex, int pageSize, out int recordCount);

        Collection<TestCase> FindTestCases(LinqPredicate predicate, string orderby, int pageIndex, int pageSize, out int recordCount);

        Collection<TestPlan> FindTestPlans(LinqPredicate predicate, string orderby, int pageIndex, int pageSize, out int recordCount);

        Collection<Build> FindBuilds(LinqPredicate predicate, string orderby, int pageIndex, int pageSize, out int recordCount);

        void DeleteTestProject(Guid entityId);

        void DeleteTestSuite(Guid entityId);

        void DeleteTestCase(Guid entityId);

        void DeleteTestPlan(Guid entityId);

        void DeleteBuild(Guid entityId);
        //get TreeNode by parentId
        Collection<HierarchyDataObject> GetChildrenTreeNode(string parentId, string testCenterHierarchyType, Collection<HierarchyDataObject> nodes);

        void AssignTestCaseToTestPlan(IEnumerable<string> testCaseIds, string testsuiteId, string testplanId);
    }
}
